package com.lmx.repoDomain.tmodel;

import io.katharsis.resource.annotations.JsonApiIncludeByDefault;
import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToOne;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import com.lmx.repoDomain.tmodel.business.User;//huibati;
import javax.persistence.*;

/**
 * 支付记录表
 */
@Entity
@Table(name = "ccd_pay_record")
@JsonApiResource(type = "payRecord")
public class PayRecord extends BaseEntity {
	private String code; // 编码
	private User user; //用户
	private Double amount; //金额
	private String sysAccount; //系统账户（呼叫云）
	private Short sysAccountType; //系统账户类型  1：微信 2：支付宝 3：银行卡
	private String userAccount; //用户账户
	private Short userAccountType; //用户账户类型  1：微信 2：支付宝 3：银行卡
	private Short payType; //支付类型 1：充值  2：提现
	private Short payChannel; //支付渠道 1：微信 2：支付宝 3：银行卡
	private Integer payTime; //支付时间
	private Short payStatus; //支付状态
//	private DealFlow dealFlow;//交易流水号
	private String failReason; //失败原因
	private double platformProportion;// 提佣比例
	private String wechatQrPay;//充值二维码地址
	private Integer createTime;//创建时间
	private String remark;//备注

	@Column(name = "code")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "user_id",foreignKey = @ForeignKey(name = "null"))
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "amount")
	public Double getAmount() {
		return amount;
	}

	public void setAmount(Double amount) {
		this.amount = amount;
	}

	@Column(name = "sys_account")
	public String getSysAccount() {
		return sysAccount;
	}

	public void setSysAccount(String sysAccount) {
		this.sysAccount = sysAccount;
	}

	@Column(name = "sys_account_type")
	public Short getSysAccountType() {
		return sysAccountType;
	}

	public void setSysAccountType(Short sysAccountType) {
		this.sysAccountType = sysAccountType;
	}

	@Column(name = "user_account")
	public String getUserAccount() {
		return userAccount;
	}

	public void setUserAccount(String userAccount) {
		this.userAccount = userAccount;
	}

	@Column(name = "user_account_type")
	public Short getUserAccountType() {
		return userAccountType;
	}

	public void setUserAccountType(Short userAccountType) {
		this.userAccountType = userAccountType;
	}

	@Column(name = "pay_type")
	public Short getPayType() {
		return payType;
	}

	public void setPayType(Short payType) {
		this.payType = payType;
	}

	@Column(name = "pay_channel")
	public Short getPayChannel() {
		return payChannel;
	}

	public void setPayChannel(Short payChannel) {
		this.payChannel = payChannel;
	}

	@Column(name = "pay_time")
	public Integer getPayTime() {
		return payTime;
	}

	public void setPayTime(Integer payTime) {
		this.payTime = payTime;
	}

	@Column(name = "pay_status")
	public Short getPayStatus() {
		return payStatus;
	}

	public void setPayStatus(Short payStatus) {
		this.payStatus = payStatus;
	}

/*	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.JOIN)
	@JoinColumn(name = "deal_flow_id",foreignKey = @ForeignKey(name = "null"))
	public DealFlow getDealFlow() {
		return dealFlow;
	}

	public void setDealFlow(DealFlow dealFlow) {
		this.dealFlow = dealFlow;
	}*/

	@Column(name = "fail_reason")
	public String getFailReason() {
		return failReason;
	}

	public void setFailReason(String failReason) {
		this.failReason = failReason;
	}

	@Column(name = "platform_proprtion")
	public double getPlatformProportion() {
		return platformProportion;
	}

	public void setPlatformProportion(double platformProportion) {
		this.platformProportion = platformProportion;
	}

	@Column(name = "wechat_qr_pay")
	public String getWechatQrPay() {
		return wechatQrPay;
	}

	public void setWechatQrPay(String wechatQrPay) {
		this.wechatQrPay = wechatQrPay;
	}

	@Column(name = "create_time")
	public Integer getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Integer createTime) {
		this.createTime = createTime;
	}

	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
}
